package com.ihc.android.datasource;

import com.ihc.android.utilities.Constants;

public class Answer {

	private long id;
	private String description;
	private Boolean isCorrect;
	private Question question;
	private Boolean isCheckedOnScreen;
	
	public Answer() {
		this(0, "", false);
	}
	
	public Answer(long id) {
		this(id, "", false);
	}
	
	public Answer(String description, Boolean isCorrect) {
		this(0, description, isCorrect);
	}
	
	public Answer(long id, String description, Boolean isCorrect) {
		this.id = id;
		this.description = description;
		this.isCorrect = isCorrect;
		this.isCheckedOnScreen = false;
	}
	
	public long getId() {
		return id;
	}
	
	public void setId(long id) {
		this.id = id;
	}
	
	public String getDescription() {
		return description;
	}
	
	public void setDescription(String description) {
		this.description = description;
	}
	
	public Boolean getIsCorrect() {
		return isCorrect;
	}
	
	public void setIsCorrect(Boolean isCorrect) {
		this.isCorrect = isCorrect;
	}
	
	public Question getQuestion() {
		return question;
	}
	
	public void setQuestion(Question question) {
		this.question = question;
	}
	
	public Boolean getIsCheckedOnScreen() {
		return isCheckedOnScreen;
	}
	
	public void setIsCheckedOnScreen(Boolean isCheckedOnScreen) {
		this.isCheckedOnScreen = isCheckedOnScreen;
	}
	
	// Will be used by the ArrayAdapter in the ListView
	@Override
	public String toString() {
		return this.description;
	}

	public String toMsgBluetooth() {
		return Long.toString(this.id) + Constants.separator + this.getDescription() +
			Constants.separator + ((this.isCorrect)?"1":"0");
	}
}
